package adv4;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class DateConvert {

	public static void main(String[] args) throws Exception {
		SimpleDateFormat df = new SimpleDateFormat();
		// 严格限制日期格式
		df.setLenient(false);
		Scanner sc = new Scanner(System.in);
		df.applyPattern("yyyy-MM-dd");
		System.out.println("请输入你的生日：");
		String s = sc.next();
		Date d = df.parse(s);
		System.out.println(d);
		df.applyPattern("yyyy/MM/dd");
		String d2 = df.format(d);
		System.out.println(d2);

	}

}
